package com.hwua.demo01;

import java.io.File;
import java.io.IOException;

/**
 * @author p
 */
public class Demo01 {
    public static void main(String[] args) {

        File file = new File("E:\\A.txt");
        //--创建文件夹
        try {
            file.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println("文件的绝对路径"+file.getAbsolutePath());
        System.out.println("剩余空间"+file.getFreeSpace());
        System.out.println(file.getName());
        System.out.println("上级目录"+file.getParent());
        System.out.println(file.getTotalSpace());
        System.out.println(file.getUsableSpace());
        System.out.println("已用空间："+(file.getTotalSpace()-file.getUsableSpace()));
    }
}
